Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh TPGs after deleting a backstore #161

Conversation

iammattcoleman
Copy link
Contributor

@iammattcoleman
Copy link
Contributor Author

@pkalever When using the daemon, 'This LUN does not exist in configFS' appears much more frequently if multiple targets are being modified with individual targetcli commands (not using batch mode) by several simultaneous users or scripts. Can you review/test this change?

@pkalever
Copy link
Contributor

pkalever commented Apr 3, 2020

@iammattcoleman certainly yes!

I remember we take blocking locks on each request.

BTW how did you reproduce this issue?
Can you add the steps that you have used to reproduce?

Thanks!

@iammattcoleman
Copy link
Contributor Author

iammattcoleman commented Apr 6, 2020

@pkalever The simplest way to reproduce it is to create a file (e.g. /tmp/lun-does-not-exist-in-configfs) with the following contents...

/backstores/fileio create test1 /tmp/test1.img 10M
/iscsi create iqn.2020-04.com.datto:test
/iscsi/iqn.2020-04.com.datto:test/tpg1/luns create /backstores/fileio/test1
/backstores/fileio delete test1
ls
/iscsi delete iqn.2020-04.com.datto:test

...and then run...

targetcli </tmp/lun-does-not-exist-in-configfs
rm /tmp/test1.img

@maurizio-lombardi
Copy link
Collaborator

Hello Matt,

I see that the code you added to ui_command_delete() contains references to iscsi, but what happens if we try to reproduce the bug with a different type of target?

@iammattcoleman
Copy link
Contributor Author

iammattcoleman commented Apr 16, 2020

@maurizio-lombardi That's my main concern with this pull request. I only have experience with iSCSI.

@gonzoleeman
Copy link
Contributor

I wasn't aware of any other protocol that has target portal groups.

@iammattcoleman
Copy link
Contributor Author

iammattcoleman commented Apr 17, 2020

@gonzoleeman I wasn't either, but apparently they all do. targetcli is clear about it for vhost targets, but doesn't say anything about loopback targets:

/> /loopback create
Created target naa.50014055630997a6.
/> /vhost create
Created target naa.5001405ef6e5af1a.
Created TPG 1.

Interestingly, they both show target portal groups in ConfigFS:

# find /sys/kernel/config/target -type d -name 'tpgt_*'
/sys/kernel/config/target/loopback/naa.50014055630997a6/tpgt_1
/sys/kernel/config/target/vhost/naa.5001405ef6e5af1a/tpgt_1

@maurizio-lombardi I'm closing this pull request for now, since it definitely needs fixing. I'll reopen it with a proper fix tomorrow.

@iammattcoleman
Copy link
Contributor Author

@gonzoleeman I opened an updated version of this pull request that handles all fabric types, including ones that don't have target portal groups: #171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants